package com.chenyun.system.event;

import com.chenyun.system.model.SysDictData;
import com.chenyun.system.service.ISysConfigService;
import com.chenyun.common.service.IStartUpService;
import com.chenyun.system.service.ISysDictDataService;
import com.chenyun.system.service.ISysDictTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 启动程序成功执行事件
 *
 * @author: Lonni
 * @date: 2022/9/30 0030 16:39
 */
@Slf4j
@Component
@Order(1)
public class SystemStartUpEvent implements IStartUpService {

    @Autowired
    private ISysConfigService configService;
    @Autowired
    private ISysDictTypeService dictTypeService;

    /**
     * 执行方法
     */
    @Override
    public void execute() {
        log.info("加载Sys_config参数开始...");
        configService.loadingConfigCache();
        //加载dict
        dictTypeService.loadingDictCache();

    }
}
